import configparser


# 封装成类
class ReadConfigIni():
    def __init__(self, filename):
        self.cf = configparser.ConfigParser()
        self.cf.read(filename)

    def getSection(self):
        return self.cf.sections()

    def getConfigValue(self, section, option):
        return self.cf.get(section, option)

    def getOption(self, section):
        return self.cf.options(section)

    def get_element_loc(self, section, option):
        location = self.getConfigValue(section, option)
        # print("From DoBingIni-location: %s" % location)
        loc_type = location.split(":")[0]
        loc_value = location.split(":")[1]
        loc = (loc_type, loc_value)
        # print("From DoBingIni-loc: ", loc)
        # print("From DoBingIni-type(loc): %s", type(loc))
        return loc
















